<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <title>电子账册详情</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <%@include file="/WEB-INF/pages/common/taglib.jsp" %>
    <%@include file="/WEB-INF/pages/common/common.jsp" %>
    <script type="text/javascript" src="${basePath}/js/ecommerce.js"></script>
    <style type="text/css">
        .table1 {
            width: auto;
        }

        tbody {
            border: solid #ccc 1px;
            width: 100%;
        }

        .table1 tr {
            border: solid #ccc 1px;
            width: 100%;
        }

        .table1 tr th {
            min-width: 80px;
            width: auto;
        }

        .table1 tr td input {
            width: 100%;
        }

        .table3 tr {
            height: 40px;
            line-height: 40px;
            border: 1px #ccc solid
        }

        .table3 input {
            width: 80%;
        }
    </style>
</head>
<div>
    <br class="content content_frame">

    <h3 class="mainTitle"><img src="${basePath}/images/icon2.png"/>电子账册详情</h3>
    <br/>
    <ul class="contentNav dib-wrap">
        <li class="dib">
            <a onclick="javascript:history.go(-1)">
                <i class='fa fa-reply'></i>&nbsp;&nbsp;返&nbsp;回 </a>
        </li>
    </ul>
    </br>
    <form id="detailForm">

        <table class="table3">
            <tr>
                <th colspan="8">字典数据信息</th>
            </tr>
            <tr>
                <td width="300">
                    <c:choose>
                        <c:when test="${! empty dictManager.codeName}">
                            ${dictManager.codeName}
                        </c:when>
                        <c:otherwise>
                            字典编码
                        </c:otherwise>
                    </c:choose>
                </td>
                <td>
                    <input name="code" value="${baseDict.code}"/>
                </td>
            </tr>
            <tr>
                <td width="300"><c:choose>
                    <c:when test="${! empty dictManager.cnNameName}">
                        ${dictManager.cnNameName}
                    </c:when>
                    <c:otherwise>
                        中文名称
                    </c:otherwise>
                </c:choose></td>

                <td>
                    <input name="cnName" id="cnName" value="${baseDict.cnName}"/>
                </td>
            </tr>
            <c:if test="${! empty dictManager.enNameKey}">
                <tr>
                    <td width="300"><c:choose>
                        <c:when test="${! empty dictManager.enNameName}">
                            ${dictManager.enNameName}
                        </c:when>
                        <c:otherwise>
                            英文名称
                        </c:otherwise>
                    </c:choose></td>
                    <td>
                        <input name="enName" id="enName" value="${baseDict.enName}"/>
                    </td>
                </tr>
            </c:if>
            <c:if test="${! empty dictManager.remarkKey}">
                <tr>
                    <td width="120"><c:choose>
                        <c:when test="${! empty dictManager.remarkName}">
                            ${dictManager.remarkName}
                        </c:when>
                        <c:otherwise>
                            备注
                        </c:otherwise>
                    </c:choose></td>
                    <td>
                        <input name="remark" id="remark" value="${baseDict.remark}"/>
                    </td>
                </tr>
            </c:if>
        </table>
    </form>
    <div class="span12 box-content">
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        账册编号
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.eBillingNo}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        预录入号
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.preNo}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        申报类型
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.decType}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        经营单位名称
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.enterpriseName}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        经营单位编码
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.enterpriseCode}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        联系人
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.contacts}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        电话
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.phone}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        企业注册资金
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.registeredCapital}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        贸易方式
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.tradeMode}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        批准证编号
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.approvalNo}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        设备金额
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.equipmentAmount}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        币制
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.currency}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        进口总额(USD)
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.imports}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        进口口岸一
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.inportOne}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        进口口岸二
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.inportTwo}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        结束有效期
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.expires}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        备案日期
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.decDate}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        备案内容
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.decContent}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        附表页数
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.decPages}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        申请人
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.decPerson}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        录入人
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.recordPerson}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        审核状态
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.decStatus}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        审核人
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.auditPerson}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="span3">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tbody>
                <tr>
                    <td class="titleCss100">
                        复审人
                    </td>
                    <td class="tdCss">
                        <input type="text"
                               value="${tElectronicBilling.reviewPerson}">
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
    </br>
    <div class='responsive-table'>
        <table id="tEBillingEquipment" style="height: 1px">
        </table>
        <%--<table id="orderBodyPage">--%>
        <%--</table>--%>
    </div>
    </br>
    <div class='responsive-table'>
        <table id="tEBillingMaterials" style="height: 1px">
        </table>
        <%--<table id="orderBodyPage">--%>
        <%--</table>--%>
    </div>
    </br>
    <div class='responsive-table'>
        <table id="tEBillingEndgood" style="height: 1px">
        </table>
        <%--<table id="orderBodyPage">--%>
        <%--</table>--%>
    </div>
    </br>
    <div class='responsive-table'>
        <table id="tEBillingConsumption" style="height: 1px">
        </table>
        <%--<table id="orderBodyPage">--%>
        <%--</table>--%>
    </div>
</div>
</div>
</form>
</div>
<script type="text/javascript">

    $(function () {
        function urlCodeMaterials(cellvalue, options, rowObject) {
            cellvalue = cellvalue || '';
            cellvalue = $.trim(cellvalue);

            var url = '${basePath}/eBilling/getTEBillingMaterialsDetail?seqNo=' + rowObject.seqNo + "&eBillingNo=${tElectronicBilling.eBillingNo}";
            return "<a class='btn-link' href=\"" + url + "\">" + "<span style='color:#00acec'>" + cellvalue + "</span></a>";
        }

        $("#tEBillingMaterials").jqGrid({
            datatype: "json",
            url: $basePath + "/eBilling/qryTEBillingMaterialsPage?eBillingNo=${tElectronicBilling.eBillingNo}",
            colNames: [
                '账册编号',
                '序号',
                '商品编码',
                '附加号',
                '商品名称'
            ],
            colModel: [
                {name: 'eBillingNo', index: 'eBillingNo', formatter: urlCodeMaterials},
                {name: 'seqNo', index: 'seqNo'},
                {name: 'goodsNo', index: 'goodsNo'},
                {name: 'addNo', index: 'addNo'},
                {name: 'goodsName', index: 'goodsName'}
            ],
            viewrecords: true,
            autowidth: true,
            height: 'auto',
            caption: '料件列表',
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            rownumWidth: 35,
            multiselect: true,
            width: $('body').width(),
            pager: "#tEBillingMaterialsPage", //分页工具栏
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $("#tEBillingMaterials").setGridWidth($(window).width() - 2);
                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });
        function urlCodeEquipment(cellvalue, options, rowObject) {
            cellvalue = cellvalue || '';
            cellvalue = $.trim(cellvalue);

            var url = '${basePath}/eBilling/getTEBillingEquipmentDetail?seqNo=' + rowObject.seqNo + "&eBillingNo=${tElectronicBilling.eBillingNo}";
            return "<a class='btn-link' href=\"" + url + "\">" + "<span style='color:#00acec'>" + cellvalue + "</span></a>";
        }

        $("#tEBillingEquipment").jqGrid({
            datatype: "json",
            url: $basePath + "/eBilling/qryTEBillingEquipmentPage?eBillingNo=${tElectronicBilling.eBillingNo}",
            colNames: [
                '账册编号',
                '序号',
                '商品编码',
                '附加号',
                '商品名称'
            ],
            colModel: [
                {name: 'eBillingNo', index: 'eBillingNo', formatter: urlCodeEquipment},
                {name: 'seqNo', index: 'seqNo'},
                {name: 'hsCode', index: 'hsCode'},
                {name: 'addNo', index: 'addNo'},
                {name: 'goodName', index: 'goodName'}
            ],
            viewrecords: true,
            autowidth: true,
            height: 'auto',
            caption: '设备列表',
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            rownumWidth: 35,
            multiselect: true,
            width: $('body').width(),
            pager: "#tEBillingEquipmentPage", //分页工具栏
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $("#tEBillingEquipment").setGridWidth($(window).width() - 2);
                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });
        function urlCodeEndGood(cellvalue, options, rowObject) {
            cellvalue = cellvalue || '';
            cellvalue = $.trim(cellvalue);

            var url = '${basePath}/eBilling/getTEBillingEndgoodDetail?seqNo=' + rowObject.seqNo + "&eBillingNo=${tElectronicBilling.eBillingNo}";
            return "<a class='btn-link' href=\"" + url + "\">" + "<span style='color:#00acec'>" + cellvalue + "</span></a>";
        }

        $("#tEBillingEndgood").jqGrid({
            datatype: "json",
            url: $basePath + "/eBilling/qryTEBillingEndgoodPage?eBillingNo=${tElectronicBilling.eBillingNo}",
            colNames: [
                '账册编号',
                '序号',
                '商品编码',
                '附加号',
                '商品名称'
            ],
            colModel: [
                {name: 'eBillingNo', index: 'eBillingNo', formatter: urlCodeEndGood},
                {name: 'seqNo', index: 'seqNo'},
                {name: 'hsCode', index: 'hsCode'},
                {name: 'addNo', index: 'addNo'},
                {name: 'goodName', index: 'goodName'}
            ],
            viewrecords: true,
            autowidth: true,
            height: 'auto',
            caption: '成品列表',
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            rownumWidth: 35,
            multiselect: true,
            width: $('body').width(),
            pager: "#tEBillingEndgoodPage", //分页工具栏
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $("#tEBillingEndgood").setGridWidth($(window).width() - 2);
                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });
        function urlCodeConsumption(cellvalue, options, rowObject) {
            cellvalue = cellvalue || '';
            cellvalue = $.trim(cellvalue);

            var url = '${basePath}/eBilling/getTEBillingConsumptionDetail?seqNo=' + rowObject.seqNo + "&eBillingNo=${tElectronicBilling.eBillingNo}";
            return "<a class='btn-link' href=\"" + url + "\">" + "<span style='color:#00acec'>" + cellvalue + "</span></a>";
        }

        $("#tEBillingConsumption").jqGrid({
            datatype: "json",
            url: $basePath + "/eBilling/qryTEBillingConsumptionPage?eBillingNo=${tElectronicBilling.eBillingNo}",
            colNames: [
                '账册编号',
                '成品名称',
                '对应料件名称',
                '单耗',
                '损耗率'
            ],
            colModel: [
                {name: 'eBillingNo', index: 'eBillingNo', formatter: urlCodeConsumption},
                {name: 'goodsName', index: 'goodsName'},
                {name: 'consumptionName', index: 'consumptionName'},
                {name: 'consumption', index: 'consumption'},
                {name: 'lossRate', index: 'lossRate'}
            ],
            viewrecords: true,
            autowidth: true,
            height: 'auto',
            caption: '单耗列表',
            shrinkToFit: false,
            autoScroll: true,
            rowNum: 10, //每页显示记录数
            rowList: [10, 20, 100], //可调整每页显示的记录数
            rownumWidth: 35,
            multiselect: true,
            width: $('body').width(),
            pager: "#tEBillingConsumptionPage", //分页工具栏
            loadComplete: function () {
                var rowNum = $(this).jqGrid('getGridParam', 'records');
                if (rowNum <= 0) {
                    if ($(this).parent().children('.norecords').length == 0)
                        $(this).parent().append("<div class=\"norecords\">暂无数据！</div>");
                    $(this).parent().children('.norecords').show();
                }
                else {//如果存在记录，则隐藏提示信息。
                    $(this).parent().children('.norecords').hide();
                }

                $("#tEBillingConsumption").setGridWidth($(window).width() - 2);
                $(".ui-jqgrid tr.ui-row-ltr td").css('text-align', 'center');
            }
        });
        $("#detailForm input,textarea").attr("disabled", true);
    });


</script>
</body>
</html>
